package com.liveinstars.api.im;

import com.liveinstars.api.im.vo.ImUserVO;
import com.onepiece.shipelves.common.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: zhouze
 * @date: 2020/5/12
 */
@FeignClient("im")
public interface ChatUserApi {

    /**
     * 屏蔽用户操作(每一次请求为一次反向操作)
     * @param userId
     * @param shieldUserId
     * @return
     */
    @PostMapping("/chatUser/shield")
    Result<Boolean> shieldUser(@RequestHeader("uid") Long userId,
                               @RequestParam("shield_user_id")Long shieldUserId,
                               @RequestParam("shield")Boolean shield);

    /**
     * 获取im的用户信息
     * @param selfId
     * @param userId
     * @return
     */
    @GetMapping("/chatUser/getUserInfo")
    Result<ImUserVO> getImUserInfo(@RequestHeader("uid") Long selfId, @RequestParam("user_id")Long userId);

    /**
     * 判断是否是屏蔽状态
     * @param selfId
     * @param userId
     * @return
     */
    @GetMapping("/chatUser/isShield")
    Result<Boolean> isShield(@RequestHeader("uid") Long selfId, @RequestParam("user_id")Long userId);
}
